package mk.com.ldm.corepoint.administration.client.lib.CustomPagingScrollTable;

import com.google.gwt.event.shared.GwtEvent;

public class PageChangedEvent extends GwtEvent<PageChangedEventHandler>{
	public static Type<PageChangedEventHandler> TYPE = new Type<PageChangedEventHandler>();
	private int currentPage = 1;
	private int pageSize = 1;
	
	public PageChangedEvent(){}
	
	public PageChangedEvent(int currentPage, int pageSize) {
		this.currentPage = currentPage;
		this.pageSize = pageSize;
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	@Override
	public Type<PageChangedEventHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(PageChangedEventHandler handler) {
		handler.onPageChanged(this);
	}

}
